<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>BNF for MyNewGrammar.jjt </TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>BNF for MyNewGrammar.jjt </H1>
<H2 ALIGN=CENTER>TOKENS</H2>
<TABLE>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
" "
| "\t"
| "\n"
| "\r"
| &lt;"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")&gt;
| &lt;"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;IF: "if"&gt;
| &lt;ELSE: "else"&gt;
| &lt;E_F: "else if"&gt;
| &lt;SWITCH: "switch"&gt;
| &lt;CASE: "case"&gt;
| &lt;DEFAULT1: "default"&gt;
| &lt;BREAK: "break"&gt;
| &lt;VOID: "void"&gt;
| &lt;WHILE: "while"&gt;
| &lt;DO: "do"&gt;
| &lt;FOR: "for"&gt;
| &lt;INT: "int"&gt;
| &lt;FLOAT: "float"&gt;
| &lt;DOUBLE: "double"&gt;
| &lt;BOOL: "bool"&gt;
| &lt;MAIN: "main"&gt;
| &lt;RETURN: "return"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;ADD: "+"&gt;
| &lt;SADD: "++"&gt;
| &lt;SSUB: "--"&gt;
| &lt;SUB: "-"&gt;
| &lt;CH: "*"&gt;
| &lt;CHU: "/"&gt;
| &lt;PRE: "%"&gt;
| &lt;BIG: "&gt;"&gt;
| &lt;SM: "&lt;"&gt;
| &lt;EQ: "="&gt;
| &lt;B_E: " &gt;="&gt;
| &lt;S_E: "&lt;="&gt;
| &lt;E_E: "=="&gt;
| &lt;N_E: "!="&gt;
| &lt;NO: "!"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;COMMA: ","&gt;
| &lt;SEMI: ";"&gt;
| &lt;COLON: ":"&gt;
| &lt;ZL: "["&gt;
| &lt;ZR: "]"&gt;
| &lt;DZ: "{"&gt;
| &lt;DY: "}"&gt;
| &lt;XZ: "("&gt;
| &lt;XY: ")"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;AND: "&amp;&amp;"&gt;
| &lt;OR: "||"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;INTEGER_LITERAL: &lt;DECIMAL_LITERAL&gt; (["l","L"])? | &lt;HEX_LITERAL&gt; (["l","L"])? | &lt;OCTAL_LITERAL&gt; (["l","L"])?&gt;
| &lt;#DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])*&gt;
| &lt;#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+&gt;
| &lt;#OCTAL_LITERAL: "0" (["0"-"7"])*&gt;
| &lt;FLOAT_LITERAL: (&lt;INTEGER_LITERAL&gt;)+ ("." (&lt;INTEGER_LITERAL&gt;)+)?&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;IDENTIFIER: &lt;LETTER&gt; (&lt;LETTER&gt; | &lt;DIGIT&gt;)*&gt;
| &lt;#LETTER: ["_","a"-"z","A"-"Z"]&gt;
| &lt;#DIGIT: ["0"-"9"]&gt;
}

   </PRE>
  </TD>
 </TR>
</TABLE>
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
<TABLE>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">Start</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod2">Procedure</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">type</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;INT&gt; | &lt;FLOAT&gt; | &lt;BOOL&gt; | &lt;DOUBLE&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">Procedure</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;VOID&gt; | &lt;INT&gt; ) &lt;MAIN&gt; &lt;XZ&gt; &lt;XY&gt; &lt;DZ&gt; ( <A HREF="#prod4">Block</A> )* &lt;DY&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">Block</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod5">Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;DZ&gt; ( <A HREF="#prod4">Block</A> )* &lt;DY&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Sequence_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">Conditional_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod8">Loop_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">Sequence_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod9">Declarative_Statement</A> | <A HREF="#prod10">Assigment_Statement</A> ) &lt;SEMI&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">Declarative_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod3">type</A> &lt;IDENTIFIER&gt; ( &lt;COMMA&gt; &lt;IDENTIFIER&gt; )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">Assigment_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( &lt;SADD&gt; | &lt;SSUB&gt; | &lt;EQ&gt; <A HREF="#prod11">Expression</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">Conditional_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod12">If_Conditional_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">Switch_Conditional_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">If_Conditional_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IF&gt; "(" <A HREF="#prod14">Logical</A> ")" <A HREF="#prod4">Block</A> ( &lt;ELSE&gt; <A HREF="#prod4">Block</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">Switch_Conditional_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;SWITCH&gt; &lt;XZ&gt; <A HREF="#prod11">Expression</A> &lt;XY&gt; &lt;DZ&gt; ( &lt;CASE&gt; &lt;IDENTIFIER&gt; &lt;COLON&gt; ( <A HREF="#prod4">Block</A> )* &lt;BREAK&gt; &lt;SEMI&gt; )* &lt;DY&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">Loop_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod15">While_Loop_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod16">Do_Loop_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod17">For_Loop_Statement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">While_Loop_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;WHILE&gt; &lt;XZ&gt; <A HREF="#prod14">Logical</A> &lt;XY&gt; &lt;DZ&gt; ( <A HREF="#prod4">Block</A> )* &lt;DY&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">Do_Loop_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;DO&gt; &lt;DZ&gt; ( <A HREF="#prod4">Block</A> )* &lt;DY&gt; &lt;WHILE&gt; &lt;XZ&gt; <A HREF="#prod14">Logical</A> &lt;XY&gt; &lt;SEMI&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">For_Loop_Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;FOR&gt; &lt;XZ&gt; ( <A HREF="#prod3">type</A> )? <A HREF="#prod10">Assigment_Statement</A> &lt;SEMI&gt; <A HREF="#prod14">Logical</A> &lt;SEMI&gt; <A HREF="#prod10">Assigment_Statement</A> &lt;XY&gt; &lt;DZ&gt; ( <A HREF="#prod4">Block</A> )* &lt;DY&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">Logical</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod18">Condition</A> ( ( &lt;AND&gt; | &lt;OR&gt; ) <A HREF="#prod14">Logical</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">Condition</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod11">Expression</A> ( <A HREF="#prod19">Relation</A> <A HREF="#prod11">Expression</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">Relation</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;E_E&gt; | &lt;N_E&gt; | &lt;S_E&gt; | &lt;B_E&gt; | &lt;BIG&gt; | &lt;SM&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">Expression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod20">AdditiveExpression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">AdditiveExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod21">MultiplicativeExpression</A> ( ( &lt;ADD&gt; | &lt;SUB&gt; ) <A HREF="#prod21">MultiplicativeExpression</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">MultiplicativeExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod22">UnaryExpression</A> ( ( &lt;CH&gt; | &lt;CHU&gt; | &lt;PRE&gt; ) <A HREF="#prod22">UnaryExpression</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">UnaryExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"(" <A HREF="#prod11">Expression</A> ")"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod23">Identifier</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod24">Integer</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">Identifier</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">Integer</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;INTEGER_LITERAL&gt;</TD>
</TR>
</TABLE>
</BODY>
</HTML>
